package com.dev.jaye.code.source.util;

import java.util.Arrays;

/**
 * @author Dev_J
 * @date 2021-04-29 22:15
 */
public class ArrayRead {
    public static void main(String[] args) {
        //Arrays类的
        int[] a = {1,52,66,11,22,67};
        //01 - toString方法，打印数组 [1, 52, 66, 11, 22, 67]
        System.out.println(Arrays.toString(a));
        System.out.println("==========================");
        //02 - sort 数组排序
        Arrays.sort(a);//升序
        System.out.println(Arrays.toString(a));

        //03 - fill 将数组以指定值填充
        Arrays.fill(a,0);
        System.out.println("Arrays.toString(a) = " + Arrays.toString(a));
        //03.01 -- 2,4 之间的数据被0填充
        Arrays.fill(a,2,4,0);
        System.out.println("2,4 之间的数据被0填充,Arrays.toString(a) = " + Arrays.toString(a));
    }
}
